/*
 *  TrackAgent.h
 *  powaah
 *
 *  Created by Tim Uusitalo on 4/19/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef TRACK_AGENT_H

#define TRACK_AGENT_H

#include "PotentialField.h"

/*
 * Keeps the car inside of the track
 * I.e., on the road, as well as aligning
 * the car on the left or right depending on whether 
 * what turn it is!
 */

#include "TrackLearner.h"

class TrackAgent : public PotentialField
{
public:
	TrackAgent();
	~TrackAgent();
	
	void update(CarState& cs, const float dt, TrackLearner& track);
	
	void update(CarState& cs, const float dt);

	const float getDistToLeft() const;
	const float getDistToRight() const;
	
	void calculatePotentialForOptions(DriverOption* const options, unsigned int size);
private:
	
	float angles[19];
	float left;
	float right;
};


#endif